import React from 'react'

interface HellowInter {
  name: string;
  firstName?: string;
}


// const Hellow = (props: HellowInter) => <h1>这是{props.name}组件</h1>


/**
 * React.FC 是react函数式组件的一个缩写
 */



const Hellow: React.FC<HellowInter> = ({
  name,
  firstName,
  children
}) => <h1>这是{name}组件{firstName}</h1>
// 默认属性 设置默认属性 ts要为可选属性
Hellow.defaultProps = {
  firstName: '默认的值'
}

export default Hellow